﻿@model Entity.Report
@{
    ViewBag.Title = "Report";
    var isEdit = (Model != null && Model.Id > 0);
}

@section breadcrumb
{
    <li>@Html.ActionLink("My task", "Index", "AssignTask")</li>
    @if (isEdit)
    {
        <li>@Html.ActionLink("Edit report", "Edit", "Task", new { id = Model.Id }, null)</li>
    }
    else
    {
        <li>@Html.ActionLink("Add Report", "Create", "Task", new { assignTaskId = Model.AssignTaskId }, null)</li>
    }
}

<div class="box box-primary">
    <div class="box-header">
        @if (isEdit)
        {
            <h3 class="box-title">Edit Report</h3>
        }
        else
        {
            <h3 class="box-title">Create Report</h3>              
        }
    </div>
    <!-- /.box-header -->
    <!-- form start -->

    @using (Html.BeginForm(isEdit ? "Edit" : "Create"))
    {
        @Html.AntiForgeryToken()
        <div class="box-body">
            <div class="form-group padding-10">
                @Html.HiddenFor(m => m.Id)
                @Html.HiddenFor(m => m.AssignTaskId)
                <label for="ReportResult">Report result</label>
                @Html.TextAreaFor(m => m.ReportResult, new { @class = "form-control" })
            </div>
            <div class="form-group padding-10">
                <label for="NextTask">Next task</label>
                @Html.TextAreaFor(m => m.NextTask, new { @class = "form-control" })
            </div>
            <div class="form-group ">
                <div class="col-md-6">
                    <label for="CompletedPercent">% Completed</label>
                    @Html.TextBoxFor(m => m.CompletedPercent, new { @class = "form-control" })
                </div>
                <div class="col-md-6">
                    <label for="ReportType">ReportType</label>
                    @Html.DropDownListFor(m=>m.ReportType, new SelectList(ViewBag.ReportTypes, "Value", "Text"), new { @class = "form-control"})     
                </div>
            </div>
            <div class="form-group padding-10">
                @Html.LabelFor(m => m.DocumentIds)
                @Html.HiddenFor(m => m.DocumentIds, new { @class = "uploadFile"})
            </div>
            @Html.ValidationSummary(true)
        </div>
        <div class="clear"></div>
        <!-- /.box-body -->
        <div class="box-footer">
            <button type="submit" class="btn btn-primary">Save</button>
            <a href="@Url.Action("Index")" class="btn btn-primary">Cancel</a>
        </div>
    }
</div>
@section Script
{
    <script type="text/javascript">
        $(function () {
            
        });
    </script>
}

